﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessLibrary.DAL;

namespace BusinessLibrary.BLL
{
    public class Module
    {
        # region var
        public int Id { get; set; }
        public string Nom { get; set; }
        public Classe classe { get; set; }

        #endregion
        #region methodes
        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static Module GetModuleById(int id)
        {
            return sqlModule.GetModuleById(id);
        }


        public static int deleteModule(int id, string nom, int id_specialite)
        {
            return sqlModule.deletModule(id, nom, id_specialite);
        }


        public static int SaveModule(Module m)
        {
            int nbRow;
            if ((nbRow = sqlModule.updateModule(m)) > 0)
                return nbRow;
            else
                return sqlModule.insertModule(m);
        }

        public static List<Module> GetListeListeModule()
        {
            return sqlModule.SelectListeModule();
        }
        #endregion
    }
}